<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
	</head>
	<body>
		<div id="app">
			<button @click="doit()">发送请求</button>
			<ul>
				<li v-for="item in jokeArray">{{item}}</li>
			</ul>
		</div>
		<script>
		var app=new Vue({
			el:"#app",
			data:{
				jokeArray:[]
			},
			methods:{
				doit:function(){
					var that=this
					axios.get("https://autumnfish.cn/api/joke/list?num=3").then(function(response){
						console.log(response.data.data)
						
						that.jokeArray=response.data.data
						console.log(that.jokeArray)
					}).catch(function(err){
						console.log(err)
						
					})
				}
				
			}
		})
		</script>
	</body>
</html>
